package com.oa.dao.impl;

import org.springframework.stereotype.Repository;

import com.oa.base.BaseDaoImpl;
import com.oa.dao.UserDao;
import com.oa.entity.User;
import com.oa.util.DataUtil;

@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	// 登录验证
	public User findUserNameAndPass(User user) {
		User user1 = (User) getSession().createQuery("from User u where u.user_loginName=? and u.user_password=?")
		.setString(0, user.getUser_loginName())
		.setString(1, DataUtil.md5(user.getUser_password()))
		.uniqueResult();
		return user1;
	}


}
